<template>
  <div class="rootModel">
      <router-view></router-view>
      <van-tabbar v-model="active" class="tabbar_box" route>
        <van-tabbar-item to='/home'>
          <span>首页</span>
          <template #icon="props">
            <svg class="icon" aria-hidden="true">
              <use :xlink:href="props.active?'#icon-shouye1':'#icon-shouye'"></use>
            </svg>
          </template>
        </van-tabbar-item>
        <van-tabbar-item to='/study' v-if="learnShow">
          <span>课程学习</span>
          <template #icon="props">
            <svg class="icon" aria-hidden="true">
              <use :xlink:href="props.active?'#icon-a-bianzu51':'#icon-a-31'"></use>
            </svg>
          </template>
        </van-tabbar-item>
        <van-tabbar-item to='/practice' v-if="isShow">
          <span>题库练习</span>
          <template #icon="props">
            <svg class="icon" aria-hidden="true">
              <use :xlink:href="props.active?'#icon-a-5':'#icon-a-2'"></use>
            </svg>
          </template>
        </van-tabbar-item>
        <van-tabbar-item to='/mine'>
          <span>我的</span>
          <template #icon="props">
            <svg class="icon" aria-hidden="true">
              <use :xlink:href="props.active?'#icon-a-1':'#icon-a-4'"></use>
            </svg>
          </template>
        </van-tabbar-item>
      </van-tabbar>
  </div>
</template>

<script>
import {mapGetters} from 'vuex'
import {delisphoto} from '@/utils/auth.js'
export default {
  computed:{
    ...mapGetters(['Jurisdictions','Jurisdiction']),
    // obj:function(){
    //   let val = this.Jurisdiction
    //   console.log(12111);
    //   if(val.专项练习=='不显示'&&val.模拟考试=='不显示'&&val.正式考试=='不显示'){
    //     this.isShow=false
    //   }
    //   this.learnShow=val.课程学习
    //   return this.Jurisdiction
    // }
  },
  data() {
    return {
      active:0,
      isShow:true,
      learnShow:true,
      // obj:this.Jurisdiction,
    }
  },
  watch:{
    // 'obj':{
    //   deep:true,
    //   handler(val) {
    //     console.log(val,'222');
    //     if(val.专项练习=='不显示'&&val.模拟考试=='不显示'&&val.正式考试=='不显示'){
    //       this.isShow=false
    //     }
    //     this.learnShow=val.课程学习
    //   },
    // }
    Jurisdiction(val){
      console.log(val);
        if(val.专项练习=='不显示'&&val.模拟考试=='不显示'&&val.正式考试=='不显示'){
          this.isShow=false
        }
        this.learnShow=val.课程学习
    }
  },
  created() {
    // delisphoto()
    //resetAdminToken
    if(this.Jurisdictions.专项练习.模块展示=='不显示'&&this.Jurisdictions.模拟考试.模块展示=='不显示'&&this.Jurisdictions.正式考试.模块展示=='不显示'){
      this.isShow=false
    }
    if(Object.keys(this.Jurisdiction).length!=0){
      this.learnShow=this.Jurisdiction.课程学习
    }
  },
}
</script>
<style scoped>
.icon {
  width: 1.25rem;
  height: 1.25rem;
  vertical-align: -0.15em;
  fill: currentColor;
  overflow: hidden;
}
</style>
<style lang="scss">
:root{
  font-size: 16px !important;
  height:100vh !important;
  min-width:100vw !important;
  #app{
    height: 100%;
  }
  body{
    font-size:0.8125rem;
    color:#333;
  }
}
</style>
<style lang="scss" scoped>
.rootModel{
  height:calc(100% - 50px);
  width: 100%;
  background: #F5F5F5 ;
  overflow: auto;
}
::v-deep{
  .van-tabbar{
    height:50px;
  }
  .tabbar_box{
    span{
      font-size: 0.69rem;
    }
  }
}
</style>
